package com.unitd.base.module.api.service;

import com.unitd.base.module.api.mybatis.mapper.ApiAddressMapper;
import com.unitd.base.module.api.entity.AddressVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ApiAddressService {
    @Autowired
    private ApiAddressMapper addressDao;

    public AddressVo queryObject(Integer id) {
        return addressDao.selectById(id);
    }

    public List<AddressVo> queryList(Map<String, Object> map) {
        return addressDao.selectByMap(map);
    }

    public void save(AddressVo address) {
        addressDao.insert(address);
    }

    public void update(AddressVo address) {
        addressDao.updateById(address);
    }

    public void delete(Integer id) {
        addressDao.deleteById(id);
    }
}
